package gui;

import javax.swing.JPanel;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JTextField;
import javax.swing.JScrollPane;

public class AppPanelStory extends JPanel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3532086094480804100L;
	public static JButton btnStoryCreate = new JButton("Create");
	public static JButton btnStoryDelete = new JButton("Delete");
	public static JButton btnStoryEdit = new JButton("Edit");
	public static JTextField txtStoryName = new JTextField();
	public static JScrollPane scrollPane = new JScrollPane();
	public static JEditorPane editorDesc = new JEditorPane();
	private final JLabel lblStory = new JLabel("Story");
	
	
	
	/**
	 * Create the panel.
	 */
	public AppPanelStory() {
		txtStoryName.setText("this is the name of your story");
		txtStoryName.setColumns(10);
		setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("75px"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		add(lblStory, "4, 2, 3, 1");
		add(btnStoryEdit, "2, 4");
		add(txtStoryName, "4, 4, 3, 1, fill, default");
		txtStoryName.setColumns(10);
		add(txtStoryName, "4, 4, 3, 1, fill, default");
		add(btnStoryDelete, "2, 6");
		scrollPane.setViewportBorder(null);
		
		add(scrollPane, "4, 6, 3, 5, fill, fill");
		editorDesc.setText("this is the description of your story");
		
		scrollPane.setViewportView(editorDesc);
		add(btnStoryCreate, "2, 8");
	}

}
